// 导入http中创建的axios实例
import axios from './http';
// urls接口地址
import urls from './urls'

//获取每个urls模块
const base      = urls.base;
const phaseFile = urls.phaseFile;
const download  = urls.download;
const tea       = urls.tea;
const phc       = urls.phc
const pt        = urls.pt
const ad        = urls.ad
const dep       = urls.dep
const bt        = urls.bt
const proRe        = urls.proRe
//登录
const login = {
    signIn: (params) => { return axios.post(`${base.signIn}`, params) },   //登录
    sendEmail:(params) => { return axios.post(`${base.sendEmail}`, params) },  //发送邮箱
    checkEmail:(params) => { return axios.post(`${base.checkEmail}`, params) },  ///校验邮箱
    findPwd: (params) => { return axios.post(`${base.findPwd}`, params) },   //获取修改密码
    initialize:(params) => { return axios.post(`${base.initialize}`, params) },//初始化
}
const nav={
    getNav: (params) => { return axios.get(`${base.getNav}`, params) },   //获取侧边栏
}
const Level={
	getAllLevel:(params)=>{	return axios.get(`${base.getAllLevel}`, params) },
}

const Label={
  creatLabel:(params)=>{	return axios.post(`${base.creatLabel}`, params) },//创建标签
  getLabels:(params)=>{	return axios.get(`${base.getLabels}`, params) },//得到所有标签
  updateLabel:(params)=>{	return axios.post(`${base.updateLabel}`, params) },//修改标签
  deleteLabel:(params)=>{	return axios.post(`${base.deleteLabel}`, params) },//删除标签
  creatExpertLabel:(params)=>{	return axios.post(`${base.creatExpertLabel}`, params) },//创建专家
  deleteExpertLabel:(params)=>{	return axios.post(`${base.deleteExpertLabel}`, params) },//删除专家
  getExpertLabels:(params)=>{	return axios.get(`${base.getExpertLabels}`, params) },//得到所有专家
}

const batch={
	getAllBatch:(params) => {return axios.get(`${base.getAllBatch}`, params) }, //获取全部批次
  getAllBatchById:(params) => {return axios.post(`${base.getAllBatchById}`, params) },
	createBatch:(params) => {return axios.post(`${base.creatBatch}`, params) },//创建批次
	deleteBatch:(params) =>	{return axios.post(`${base.deleteBatch}`, params) },//删除批次
	editBatch:	(params) =>	{return axios.post(`${base.editBatch}`, params) },//修改批次
	getProjectClassification:(params) => {return axios.post(`${base.getProjectClassification}`, params) },//查询该批次下项目的类别信息
	selectMaxHost:(params) => {return axios.post(`${base.selectMaxHost}`, params) },//查询批次下最大主持数
	selectMaxParticipants:(params) => {return axios.post(`${base.selectMaxParticipants}`, params) },//查询批次下最大参与数
	getProjectByBatchId:(params) => {return axios.post(`${base.getProjectByBatchId}`, params)},//获取目标批次下的所有项目
  getBatchByDepId:(params) => {return axios.post(`${base.getBatchByDepId}`, params)},//通过授权的学院id，得到批次信息
  updateBatchStatus:(params) => {return axios.post(`${base.updateBatchStatus}`, params)},//更改批次状态
  getBatchInfoByExpert:(params) => {return axios.get(`${base.getBatchInfoByExpert}`, params)},//通过教师工号获取专家batchId信息
  getBatchName:(params) => {return axios.get(`${base.getBatchName}`, params)},//获取批次id和名称
  getBatchInfoIncludeDelay:(params) => {return axios.post(`${bt.getBatchInfoIncludeDelay}`, params)},//在已结项的批次中，查找延期的项目
}

const expert={
  creatExpert:(params) =>	{return axios.post(`${base.creatExpert}`, params) },//修改批次
  deleteExpert:(params) =>	{return axios.post(`${base.deleteExpert}`, params) },//删除批次与专家的关联
  getExperts:(params) =>	{return axios.get(`${base.getExperts}`, params) },//获取全部专家信息
  getExpertByBatchId:(params) =>	{return axios.post(`${base.getExpertByBatchId}`, params) },//通过batchId获取专家信息
  creatExpertScore:(params) =>	{return axios.post(`${base.creatExpertScore}`, params) },//创建专家成绩
  getExpertScoreByProId:(params) =>	{return axios.post(`${base.getExpertScoreByProId}`, params) },//创建专家成绩
  updateExpertScore:(params) =>	{return axios.post(`${base.updateExpertScore}`, params) },//创建专家成绩
  getExpertScores:(params) =>	{return axios.get(`${base.getExpertScores}`, params) },//获取所有专家成绩
  getPhaseIdByExpert:(params) =>	{return axios.get(`${base.getPhaseIdByExpert}`, params) },//通过教师工号获取专家phaseId信息
}
const project ={
	getRecentProject:(params) => {return axios.post(`${base.getRecentProject}`, params)},//得到最近教师最近的申报项目信息
	creatProjects:(params) => {return axios.post(`${base.creatProjects}`, params)},
	upload:(params) => {return axios.post(`${base.upload}`, params)},//上传文件Test
	nameRate:(params) => {return axios.post(`${base.nameRate}`, params)},//项目名查重
	getProjectById:(params) => {return axios.post(`${base.getProjectById}`, params)},//通过id获得项目信息
	updateProject:(params) => {return axios.post(`${base.updateProject}`, params)},//更新项目
	insertProjectMember:(params) => {return axios.post(`${base.insertProjectMember}`, params)},//更新项目
	deleteProjectMember:(params) => {return axios.post(`${base.deleteProjectMember}`, params)},//更新项目
	insertProjectTeaching:(params) => {return axios.post(`${base.insertProjectTeaching}`, params)},//更新项目
	deleteProjectTeaching:(params) => {return axios.post(`${base.deleteProjectTeaching}`, params)},//更新项目
	insertProjectSearching:(params) => {return axios.post(`${base.insertProjectSearching}`, params)},//更新项目
	deleteProjectSearchingBySearchingId:(params) => {return axios.post(`${base.deleteProjectSearchingBySearchingId}`, params)},//更新项目
  setNumProject:(params) => {return axios.post(`${base.setNumProject}`, params)},//设置项目最大通过数
  setNumProjects:(params) => {return axios.post(`${base.setNumProjects}`, params)},//批量设置项目最大通过数
  getAllNumProject:(params) => {return axios.post(`${base.getAllNumProject}`, params)},//获取所有项目数信息
  creatRecord:(params) => {return axios.post(`${base.creatRecord}`, params)},//新建日志
  getRecordByProId:(params) => {return axios.post(`${base.getRecordByProId}`, params)},//根据项目id获取所有日志
  getProjectsByGH:(params) => {return axios.post(`${base.getProjectsByGH}`, params)},//根据gh获取该教师主持的项目信息
  getHostProjects:(params) => {return axios.get(`${base.getHostProjects}`, params)},//根据gh获取该教师主持的简单项目信息
  getPartakeProjects:(params) => {return axios.get(`${base.getPartakeProjects}`, params)},//根据gh获取该教师主持的简单项目信息
  updateProByProId:(params) => {return axios.post(`${base.updateProByProId}`, params)},//通过项目id修改项目状态
  updateProsByProId:(params) => {return axios.post(`${base.updateProsByProId}`, params)},//通过项目id修改项目状态
  addDelayCauseByProId:(params) => {return axios.post(`${base.addDelayCauseByProId}`, params)},//通过项目id批量修改项目状态
  getDelayCauseByProId:(params) => { return axios.post(`${base.getDelayCauseByProId}`, params) },//根据阶段文件检查编号修改阶段文件检查状态
  getAllDelayProject:(params) => { return axios.get(`${base.getAllDelayProject}`, params) },//获取所有延期简单项目信息
  getAllDelayProjectById:(params) => { return axios.post(`${base.getAllDelayProjectById}`, params) },//根据延期编号获取所有延期简单项目信息
  getNotTemporaryProject:(params) => { return axios.get(`${base.getNotTemporaryProject}`, params) },//根据教师信息获取指定学院的非暂存项目信息
  addProject:(params) => { return axios.post(`${proRe.addProject}`, params) },//新建项目状态更改记录
  deleteProject:(params) => { return axios.post(`${proRe.deleteProject}`, params) },//删除项目状态更改记录
  getAllProject:(params) => { return axios.get(`${proRe.getAllProject}`, params) },//查询所有项目状态更改记录
  deleteProjects:(params) => { return axios.post(`${proRe.deleteProjects}`, params) },//批量删除项目状态更改记录

}

const file ={
  fileDelete:(params) => {return axios.post(`${base.fileDelete}`, params)},//文件删除
  fileDownload:(params) => {return axios.get(`${download.fileDownload}`, params)},//文件删除

}

const teacher = {
    getNavById: (params) => { return axios.post(`${base.getNavById}`, params) },
    getTeacherTypeByGH: (params) => { return axios.post(`${base.getTeacherTypeByGH}`, params) },//根据教师工号获取身份信息
    getAllTeacherInfo: (params) => { return axios.get(`${base.getAllTeacherInfo}`, params) },   //获取全部教师信息
    getDefaultLocalTeacherInfo: (params) => { return axios.get(`${base.getDefaultLocalTeacherInfo}`, params) },   //获取当前用户信息-本地库
    getDefaultTeacherInfo: (params) => { return axios.get(`${base.getDefaultTeacherInfo}`, params) },   //获取当前用户信息
    changeEmail: (params) =>{ return axios.post(`${base.changeEmail}`, params) },//修改邮箱
    changePassword: (params) => { return axios.post(`${base.changePassword}`, params) },//修改用户密码
    resetTeacher:(params) => { return axios.post(`${base.resetTeacher}`, params) },   //重置当前教师账号
    getTeacherDealt:(params) => { return axios.get(`${tea.getTeacherDealt}`, params) },   //获取教师待办事项
    changeIdentity:(params) => { return axios.post(`${tea.changeIdentity}`, params) },   //切换身份(token)
}
const department = {
    getSchoolDepartments:(params) => { return axios.get(`${base.getSchoolDepartments}`, params) },   //获取全部部门信息
    authDepartment:(params) => { return axios.post(`${base.authDepartment}`, params) },   //授权部门 post
    editDepartment:(params) => { return axios.post(`${base.editDepartment}`, params) },//
    getDepartmentPhaseByDepId:(params) => { return axios.get(`${dep.getDepartmentPhaseByDepId}`, params) },//查看部门下批次的关系
    addDepartmentPhase:(params) => { return axios.post(`${dep.addDepartmentPhase}`, params) },//绑定部门与批次的关系
}
const system = {
    transferSuperAuth:(params) => { return axios.post(`${base.transferSuperAuth}`, params) },   //转让超级管理员
}
const phase = {
    creatPhase:(params) => { return axios.post(`${base.creatPhase}`, params) },   //创建阶段检查
    insertBatchPhase:(params) => { return axios.post(`${base.insertBatchPhase}`, params) },   //创建阶段检查与批次的关系
    getAllPhase:(params) => { return axios.get(`${base.getAllPhase}`, params) },   //获取全部阶段检查信息
    deletePhaseById:(params) => { return axios.post(`${base.deletePhaseById}`, params) },   //删除阶段检查信息
    getPhaseById:(params) => { return axios.post(`${base.getPhaseById}`, params) },   //通过阶段id获取阶段检查信息
    updatePhase:(params) => { return axios.post(`${base.updatePhase}`, params) },   //删除阶段检查信息
    deleteBatchPhases:(params) => { return axios.post(`${base.deleteBatchPhases}`, params) },//批量删除阶段检查信息
    getBatchNameByPhaseId:(params) => { return axios.post(`${base.getBatchNameByPhaseId}`, params) },//通过PhaseId获取所有阶段检查信息
    getSimplifyProjectByBatchId:(params) => { return axios.post(`${base.getSimplifyProjectByBatchId}`, params) },//根据批次id获取简单项目信息
    addPhaseFiles:(params) => { return axios.post(`${base.addPhaseFiles}`, params) },//根据批次id获取简单项目信息
    deletePhaseFile:(params) => { return axios.post(`${base.deletePhaseFile}`, params) },//删除阶段检查文件信息
    getPhaseFileByProId:(params) => { return axios.post(`${base.getPhaseFileByProId}`, params) },//根据项目编号获取阶段检查文件信息
    getPhaseFileByPhaseId:(params) => { return axios.post(`${base.getPhaseFileByPhaseId}`, params) },//根据项目编号获取阶段检查文件信息
    getPhaseFileById:(params) => { return axios.post(`${phaseFile.getPhaseFileById}`, params) },//根据项目编号和阶段检查编号获取阶段检查文件信息
    updateStatusByPfId:(params) => { return axios.post(`${phaseFile.updateStatusByPfId}`, params) },//根据阶段文件检查编号修改阶段文件检查状态
    updatePhaseStatus:(params) => { return axios.post(`${phc.updatePhaseStatus}`, params) },//根据阶段文件检查编号修改阶段文件检查状态
    updateScore:(params) => { return axios.post(`${pt.updateScore}`, params) },//更改打分表
    getNotSelectPhaseByPhaseId:(params) => { return axios.post(`${pt.getNotSelectPhaseByPhaseId}`, params) },//获得已选批次
    getSelectByPhaseId:(params) => { return axios.post(`${pt.getSelectByPhaseId}`, params) },//获得未选批次
    getSimplifyProjectByPhaseId:(params) => { return axios.post(`${pt.getSimplifyProjectByPhaseId}`, params) },//根据阶段id获取简单项目信息
}
const admin = {
    setDepartmentAdmin:(params) => { return axios.post(`${ad.setDepartmentAdmin}`, params) },//设置部门管理员
}

export default {
    login,nav,teacher,department,system,batch,Level,project,Label,expert,phase,file,admin
}
